import { TGuildAltar } from "../../../Message/Db/Tables/TGuildAltar";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class GuildAltarConfig
    
    export  class GuildAltarConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            this._all = [];
            if (GuildAltarConfig._instance != null) 
            {
                throw new Error(" GuildAltarConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TGuildAltar();
                loc1.level = loc2.level;
                loc1.bossId = loc2.bossId;
                loc1.sence = loc2.sence;
                loc1.resourceCost = loc2.resourceCost;
                loc1.baseExp = loc2.baseExp;
                this._map[loc1.level] = loc1;
                this._all.push(loc1);
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_guild_altar.json");
            this.write(loc1);
            return;
        }

        public getConfigByLevel(arg1: int): TGuildAltar
        {
            return this._map[arg1];
        }

        public GuildAltarConfig.get all(): Array<any>
        {
            return this._all;
        }

        public static get instance(): GuildAltarConfig
        {
            if (GuildAltarConfig._instance == null) 
            {
                GuildAltarConfig._instance = new GuildAltarConfig();
            }
            return GuildAltarConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_all: Array<any>;

        /* internal */ static /* var */_instance: GuildAltarConfig;
    }
